import { AppComponentOutput } from './app-component-output.entity'
import { Entity, PrimaryGeneratedColumn, OneToMany, ManyToOne } from 'typeorm'
import { AppPage } from './app-page.entity'
import { AppComponentInput } from './app-component-input.entity'

@Entity()
export class AppComponent {
  @PrimaryGeneratedColumn()
  id: number

  selector: string

  @OneToMany(type => AppComponentInput, input => input.component)
  inputs: AppComponentInput[]

  @OneToMany(type => AppComponentOutput, output => output.component)
  outputs: AppComponentOutput[]

  @ManyToOne(type => AppPage, page => page.components)
  page: AppPage
}
